package jtk.project4.fleet.field;

import java.awt.Checkbox;
import java.awt.FlowLayout;

import jtk.project4.fleet.action.EditTireHistoryAction;

import nl.coderight.jazz.action.Action;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.button.CheckButton;
import nl.coderight.jazz.form.field.button.PushButton;

public class TireHistory2Field extends GroupControl<String>{
	private PushButton editButton;
	private PushButton deleteButton;
	private PushButton printButton;
	private PushButton filterButton;
	private PushButton searchButton;
	private CheckButton showRowFilter;
	
	private Action editTireHistory;
	
	public TireHistory2Field(String bindID){
		//setTitle("header.TireHistoryField");
		editTireHistory = new EditTireHistoryAction();
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields(){
		editButton = new PushButton(editTireHistory);
		deleteButton = new PushButton("Cancel");
		printButton = new PushButton("Print");
		filterButton = new PushButton("Filter");
		searchButton = new PushButton("Search");
		showRowFilter = new CheckButton("Show Row Filter");
	}
	
	private void createLayout() {
		setLayout(new FormLayout())
		.addField(CreateButtons())
		.addField(showRowFilter)
		;
	}
	
	private GroupControl CreateButtons() {
		GroupControl buttons = new GroupControl();
		buttons.setLayout(new FlowLayout(FlowLayout.CENTER));
		buttons.addField(editButton);
		buttons.addField(deleteButton);
		buttons.addField(printButton);
		buttons.addField(filterButton);
		buttons.addField(searchButton);
		return buttons;
	}
}